﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleServiceBus.Bus.MessageManagement;

namespace SimpleServiceBus.Bus.Pipeline
{
    public interface IMessageProcessingErrorHandler
    {
        /// <summary>
        /// Handle the incoming message processing error. Return true to continue propegation of this error, including
        /// possible rethrows, or false to indicate this exception has been fully handled and does
        /// not require further processing.
        /// </summary>
        /// <param name="exception">The error</param>
        /// <param name="message">The message being processed when the error occurred</param>
        /// <param name="messageBus">The message bus that encountered the error</param>
        /// <returns></returns>
        bool HandleMessageProcessingError(ref MessageProcessingException exception, MessageEnvelope message, IMessageBus messageBus);
    }
}
